use "experimental_data.dta", clear

global controls "age male above_median_income iq stem"


// Table D.1: Number of participants by bias and condition
preserve
bys task condition id: gen task_question=_n
bys task: tab condition if task_question==1
restore


// Table D.2: background characteristics
preserve
bys id: keep if _n==1
bys high_incentives: sum age male gpa raven consumption income
ttest age, by(high_incentives)
prtest male, by(high_incentives)
ttest gpa, by(high_incentives)
ttest raven, by(high_incentives)
ttest consumption, by(high_incentives)
ttest income, by(high_incentives)
restore


// Table D.3: log-transformed response times by condition
fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	eststo: qui reg response_time_logs no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	eststo: qui reg response_time_logs no_stakes high_stakes i.task_type_no, cl(id)

esttab 	using "Tables/response_time_log.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Task type FE=*task_type_no") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{7}{c}{Log (1+Response time [seconds])} \\\cmidrule(lr){2-8}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} && All \\\cmidrule(lr){3-4}\cmidrule(lr){5-6}  \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & Anchoring & tasks\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")

		

// Table D.4: Non-parametric tests response times
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	ranksum response_time if task_type=="`i'" & (condition=="no" | condition=="high"), by(high_stakes)
	ranksum response_time if task_type=="`i'" & (condition=="low" | condition=="high"), by(high_stakes)
	ranksum response_time if task_type=="`i'" & (condition=="no" | condition=="low"), by(no_stakes)
}


// Table D.5: Non-parametric tests performance
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive{
	ranksum correct if task_type=="`i'" & (condition=="no" | condition=="high"), by(high_stakes)
	ranksum correct if task_type=="`i'" & (condition=="low" | condition=="high"), by(high_stakes)
	ranksum correct if task_type=="`i'" & (condition=="no" | condition=="low"), by(no_stakes)
}

// Table D.6: Regressions response times pre-registered sample
preserve
keep if first1140==1

fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	eststo: qui reg response_time no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	eststo: qui reg response_time no_stakes high_stakes i.task_type_no, cl(id)

esttab 	using "Tables/response_time_prereg.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Task type FE=*task_type_no") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{7}{c}{Response time [seconds]} \\\cmidrule(lr){2-8}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} && All \\\cmidrule(lr){3-4}\cmidrule(lr){5-6}  \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & Anchoring & tasks\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")

restore
		
		
		
// Table D.7: Regressions performance pre-registered sample
preserve
keep if first1140==1
fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive{
	eststo: qui reg correct no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	eststo: qui reg correct no_stakes high_stakes i.task_type_no if task_type!="anchoring", cl(id)
	eststo: qui reg response no_stakes high_stakes anchor inter_anchor_no inter_anchor_high if task_type=="anchoring", cl(id)

esttab 	using "Tables/performance_prereg.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Task type FE=*task_type_no") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{6}{c}{1 if answer correct} & Answer \\\cmidrule(lr){2-7}\cmidrule(lr){8-8}\\ Omitted category: & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} & Tasks & \\\cmidrule(lr){3-4}\cmidrule(lr){5-6} \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & 1--5 &Anchoring\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")

restore


// Table D.8: Regressions response times with controls

fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	eststo: qui reg response_time no_stakes high_stakes $controls i.spec_task_no if task_type=="`i'", cl(id)
	}
	eststo: qui reg response_time no_stakes high_stakes $controls i.spec_task_no, cl(id)

esttab 	using "Tables/response_time_controls.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Question FE=*task*") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{7}{c}{Response time [seconds]} \\\cmidrule(lr){2-8}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} && All \\\cmidrule(lr){3-4}\cmidrule(lr){5-6}  \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & Anchoring & tasks\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")



// Table D.8: Regressions performance with controls

fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive{
	eststo: qui reg correct no_stakes high_stakes $controls i.spec_task_no if task_type=="`i'", cl(id)
	}
	eststo: qui reg correct no_stakes high_stakes $controls i.spec_task_no if task_type!="anchoring", cl(id)
	eststo: qui reg response no_stakes high_stakes anchor inter_anchor_no inter_anchor_high $controls if task_type=="anchoring", cl(id)

esttab 	using "Tables/performance_controls.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Question FE=*task*") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{6}{c}{1 if answer correct} & Answer \\\cmidrule(lr){2-7}\cmidrule(lr){8-8}\\ Omitted category: & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} & Tasks & \\\cmidrule(lr){3-4}\cmidrule(lr){5-6} \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & 1--5 &Anchoring\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")


				
// Table D.9: Regressions absolute distance / within 2pp for BRN

fvset base 1 spec_task_no 		

eststo clear
foreach i in brn_abstract brn_intuitive{
	eststo: qui reg dist_brn no_stakes high_stakes i.spec_task_no if task_type=="`i'", cl(id)
	eststo: qui reg dist_brn no_stakes high_stakes $controls i.spec_task_no if task_type=="`i'", cl(id)
	}
foreach i in brn_abstract brn_intuitive{
	eststo: qui reg brn_response_within2 no_stakes high_stakes i.spec_task_no if task_type=="`i'", cl(id)
	eststo: qui reg brn_response_within2 no_stakes high_stakes $controls i.spec_task_no if task_type=="`i'", cl(id)
	}

esttab 	using "Tables/dist_brn.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Question FE=*task*") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{8}{c}}\toprule\toprule&\multicolumn{8}{c}{\textit{Dependent variable:}}\\[.1cm]  &\multicolumn{4}{c}{|Answer - Bayesian posterior|} &\multicolumn{4}{c}{1 if |Answer - Bayesian posterior| $\leq2$}\\\cmidrule(lr){2-5}\cmidrule(lr){6-9}\\ Omitted category:  &  \multicolumn{8}{c}{Base rate neglect}   \\ Standard incentives & \multicolumn{2}{c}{Abstract} & \multicolumn{2}{c}{Intuitive}&\multicolumn{2}{c}{Abstract} & \multicolumn{2}{c}{Intuitive}\\\cmidrule(lr){2-3}\cmidrule(lr){4-5}\cmidrule(lr){6-7}\cmidrule(lr){8-9}")


// Table D.10: Regressions intuitive mistakes
		
fvset base 1 spec_task_no 	

eststo clear
	
foreach i in crt brn_abstract brn_intuitive {
	eststo: reg intuitive_response no_stakes high_stakes  if task_type=="`i'", cl(id)
	}


foreach i in  wason_abstract wason_intuitive{
	eststo: reg wason_mistake_type_1 no_stakes high_stakes if task_type=="`i'", cl(id)
	eststo: reg wason_mistake_type_2 no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	
eststo: reg intuitive_response no_stakes high_stakes  if task=="Anchor", cl(id)


esttab 	using "Tables/mistakes.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate() ///
		se(2) b(2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{8}{c}}\toprule\toprule&\multicolumn{8}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{8}{c}{Gives Intuitive Answer} \\\cmidrule(lr){2-9}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{4}{c}{Contingent reasoning} &  \\\cmidrule(lr){3-4}\cmidrule(lr){5-8}  \textit{Standard incentives} & CRT & Abstract & Intuitive & \multicolumn{2}{c}{Abstract} & \multicolumn{2}{c}{Intuitive}  & Anchoring\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-6}\cmidrule(lr){7-8}\cmidrule(lr){9-9}\\  & Intuitive response & \multicolumn{2}{c}{Report diagnosticity} &  Turns only P & Turns P and Q & Turns only P & Turns P and Q & Guess = anchor \\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8}\cmidrule(lr){9-9}")

	

// Table D.11: Performance, response times, and cognitive skills

fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive{
	eststo:  reg correct response_time_min iq no_stakes high_stakes  i.spec_task_no if task_type=="`i'", cl(id)
	}
	reg  response response_time_min iq anchor inter_anchor_response inter_anchor_iq no_stakes high_stakes   i.spec_task_no  inter_anchor_no inter_anchor_high if task_type=="anchoring", cl(id)


	
				
// Table D.12: Regressions confidence

fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	eststo: qui reg confidence no_stakes high_stakes if task_type=="`i'", cl(id)
	}

esttab 	using "Tables/confidence.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate() ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{6}{c}}\toprule\toprule&\multicolumn{6}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{6}{c}{Confidence [0--7]} \\\cmidrule(lr){2-7}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} &  \\\cmidrule(lr){3-4}\cmidrule(lr){5-6}  \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & Anchoring\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7} ")

		

		
// Table D.13: Regressions response times sample correct memory

preserve
keep if memory_correct==1
fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive anchoring{
	eststo: qui reg response_time no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	eststo: qui reg response_time no_stakes high_stakes i.task_type_no, cl(id)

esttab 	using "Tables/response_time_memory.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Task type FE=*task_type_no") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{7}{c}{Response time [seconds]} \\\cmidrule(lr){2-8}\\ Omitted category:  & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} && All \\\cmidrule(lr){3-4}\cmidrule(lr){5-6}  \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & Anchoring & tasks\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")
restore
		
		
		
// Table D.14: Regressions performance sample correct memory

preserve
keep if memory_correct==1
fvset base 1 spec_task_no 		

eststo clear
foreach i in crt brn_abstract brn_intuitive wason_abstract wason_intuitive{
	eststo: qui reg correct no_stakes high_stakes if task_type=="`i'", cl(id)
	}
	eststo: qui reg correct no_stakes high_stakes i.task_type_no if task_type!="anchoring", cl(id)
	eststo: qui reg response no_stakes high_stakes anchor inter_anchor_no inter_anchor_high if task_type=="anchoring", cl(id)

esttab 	using "Tables/performance_memory.tex", ///
		booktabs nonotes replace compress  label nomtitles ///
		indicate("Task type FE=*task_type_no") ///
		se(2) b(a2) r2(2)  star(* 0.05 ** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{6}{c}{1 if answer correct} & Answer \\\cmidrule(lr){2-7}\cmidrule(lr){8-8}\\ Omitted category: & & \multicolumn{2}{c}{Base rate neglect} & \multicolumn{2}{c}{Contingent reasoning} & Tasks & \\\cmidrule(lr){3-4}\cmidrule(lr){5-6} \textit{Standard incentives} & CRT & Abstract & Intuitive &Abstract & Intuitive & 1--5 &Anchoring\\\cmidrule(lr){2-2}\cmidrule(lr){3-3}\cmidrule(lr){4-4}\cmidrule(lr){5-5}\cmidrule(lr){6-6}\cmidrule(lr){7-7}\cmidrule(lr){8-8} ")

restore		
		
		


		
